using UnityEngine;
using QFramework;

namespace ProjectSurvivor
{
	public partial class FxController : ViewController
	{
		private static FxController mDefault;
		void Awake()
		{
			mDefault = this;
		}
		void OnDestroy()
		{
			mDefault = null;
		}
		public static void Play(SpriteRenderer sprite,Color dissolveColor)
		{
			mDefault.Circle.Instantiate()
			.Position(sprite.Position())
			.LocalScale(sprite.Scale()).
			Self(die=>
			{
				die.GetComponent<Dissolve>().DissolveColor = dissolveColor;
				die.sprite = sprite.sprite;
			}).Show();
		}
	}
}
